<template>
  <!--  <div></div>-->
  <div class="h-full w-full flex">
    <div class="h-full bg-white" style="width: 240px">
      <el-menu :default-active="activeKey"
               class=""
               :ellipsis="false"
               :default-openeds="['1']"
               router
               text-color="#607289"
               @select="(e)=>{activeKey = e}">
        <el-menu-item :index="'/' + tenantInfo.tenantCode + '/dashboard/workflow-mnt/workflow-design'">
          <span>流程设计</span>
        </el-menu-item>
        <el-sub-menu index="1">
          <template #title>
            <span>流程管理</span>
          </template>
          <el-menu-item :index="'/' + tenantInfo.tenantCode + '/dashboard/workflow-mnt/workflow-instance'">流程实例</el-menu-item>
          <el-menu-item :index="'/' + tenantInfo.tenantCode + '/dashboard/workflow-mnt/history-task'">历史任务</el-menu-item>
          <el-menu-item :index="'/' + tenantInfo.tenantCode + '/dashboard/workflow-mnt/history-workflow'">历史流程</el-menu-item>
        </el-sub-menu>
      </el-menu>
    </div>
    <div class="w-full h-full ml-0.5 bg-white">
      <router-view class="h-full w-full"/>
    </div>
  </div>
</template>

<script setup>
import {onMounted, onUnmounted, ref, reactive} from 'vue'
import {useRouter, useRoute} from 'vue-router';
import defaultLogo from "@/assets/images/default-logo.png";
import defaultAvatar from "@/assets/images/default-avatar.jpg";
import {$localStorage} from "@/utils/application-storage.js";

const $router = useRouter();
const $route = useRoute();

const tenantInfo = ref({
  logo: defaultLogo,
  tenantCode: '',
  systemName: ''
})
const myProfile = ref({
  avatarUrl: defaultAvatar,
  realName: ''
})
let activeKey = ref($route.fullPath)


onMounted(() => {
  tenantInfo.value = $localStorage.getTenantInfo()
  myProfile.value = $localStorage.getMyProfile()
});
onUnmounted(() => {
});

</script>

<style lang="less" scoped>
</style>
